package com.lh.java.basic.grammer;

import java.util.Calendar;

public class TestCalendar {
	public static void main(String[] args) {
		Calendar cal1 = Calendar.getInstance();
		cal1.set(2000, 7, 31, 0, 0 , 0); //2000-8-31
		cal1.set(Calendar.MONTH, Calendar.SEPTEMBER); //应该是 2000-9-31，也就是 2000-10-1
		cal1.set(Calendar.DAY_OF_MONTH, 30); //如果 Calendar 转化到 2000-10-1，那么现在的结果就该是 2000-10-30
		System.out.println(cal1.getTime()); //输出的是2000-9-30，说明 Calendar 不是马上就刷新其内部的记录
		cal1.set(2002, 7, 31, 0, 0 , 0); //2000-8-31
		System.out.println(cal1.getTime());
	}

}
